import React from 'react';
import { Balloon } from '@teamix/ui';
import docs from 'utils/docs';
import intl from '../../../../../../../../../locale';

export default class CloneToolTip extends React.Component {
  render() {
    const { disabled, trigger, isAliyunGray, ...rest } = this.props;
    if (!disabled) {
      return trigger;
    }

    return (
      <Balloon.Tooltip
        align="t"
        type={'normal'}
        trigger={trigger}
        popupContainer={(triggerEl) => triggerEl.parentNode}
        {...rest}
      >
        <div>
          {intl.get({
            id: 'code-assets.repositoryPermissions.containers.cloneTootip.AdvancedFeaturesInInternalTesting',
            defaultMessage: '高级功能内测中，支持',
          })}
          <a href={docs('clone-download-control')} target="_blank" rel="noreferrer">
            {intl.get({
              id: 'code-assets.repositoryPermissions.containers.cloneTootip.SubmitATicket',
              defaultMessage: '提交工单',
            })}
          </a>
          {intl.get({
            id: 'code-assets.repositoryPermissions.containers.cloneTootip.ApplyForUse',
            defaultMessage: '申请使用',
          })}
        </div>
      </Balloon.Tooltip>
    );
  }
}
